package Mediator;

import java.util.ArrayList;
import java.util.List;

public class Airport implements Colleague {
    private List<String> consumers = new ArrayList<>();
    private Mediator mediator;
    @Override
    public void setMediator(Mediator mediator) {
        this.mediator = mediator;
    }
    @Override
    public void addConsumer(String name) {
        if(!consumers.contains(name)) {
            consumers.add(name);
            mediator.transmitConsumer(name);
        }
    }
    @Override
    public List<String> getList() {
        return consumers;
    }
}
